library(ggmap)
qmap("Mannheim")
MA_map <- qmap("Mannheim",zoom=14)
13 April 2015
library(ggmap)
qmap("Mannheim")
MA_map <- qmap("Mannheim",zoom=14)
qmap(location = 'Mannheim', zoom = 12)
qmap(location = 'Mannheim', zoom = 13)
qmap(location = 'Mannheim', zoom = 20)
qmap(location = 'Mannheim', zoom = 14, source="osm")
qmap(location = 'Mannheim', zoom = 14, maptype="satellite")
qmap(location = 'Mannheim', zoom = 14, maptype="hybrid")
qmap(location = 'Mannheim', zoom = 14, maptype="toner",source="stamen")
MAmap <- get_googlemap("Mannheim")
ggmap(MAmap)
Geocoding (…) uses a description of a location, most typically a postal address or place name, to find geographic coordinates from spatial reference data …
geocode("Mannheim University")
| lon | lat |
|---|---|
| 8.462233 | 49.48371 |
POI1 <- geocode("B2, 1 Mannheim")
POI2 <- geocode("Hbf Mannheim")
POI3 <- geocode("Wasserturm Mannheim")
POI <- c("B2, 1 Mannheim","Hbf Mannheim",
"Wasserturm Mannheim")
ListPOI <- data.frame(lat=NA,lon=NA)
for ( i in 1:length(POI)){
geoPOI <- geocode(POI[i])
ListPOI[i,"lat"] <- geoPOI$lat
ListPOI[i,"lon"] <- geoPOI$lon
}
Article by David Kahle and Hadley Wickham on the usage of ggmap.
MA_map + geom_point(aes(x = lon, y = lat), data = ListPOI)
ListPOI$color <- c("A","B","C")
MA_map +
geom_point(aes(x = lon, y = lat,col=color),
data = ListPOI)
ListPOI$size <- c(10,20,30) MA_map + geom_point(aes(x = lon, y = lat,col=color,size=size), data = ListPOI)
mapdist("Q1, 4 Mannheim","B2, 1 Mannheim")
## from to m km miles seconds minutes ## 1 Q1, 4 Mannheim B2, 1 Mannheim 746 0.746 0.4635644 200 3.333333 ## hours ## 1 0.05555556
mapdist("Q1, 4 Mannheim","B2, 1 Mannheim",mode="walking")
## from to m km miles seconds minutes ## 1 Q1, 4 Mannheim B2, 1 Mannheim 546 0.546 0.3392844 421 7.016667 ## hours ## 1 0.1169444
mapdist("Q1, 4 Mannheim","B2, 1 Mannheim",mode="bicycling")
## from to m km miles seconds minutes ## 1 Q1, 4 Mannheim B2, 1 Mannheim 555 0.555 0.344877 215 3.583333 ## hours ## 1 0.05972222
library(geosmdata2)
xml_obj <- get_osm_nodes("bakery","Berlin")
info <- extract_info_op(xml_obj,"bakery")
library(ggmap) Imap <- qmap(location = "Berlin", zoom = 10, maptype="toner",source="stamen") Imap
The example is taken from here
Imap + geom_density2d(data = info, aes(x = lon, y = lat),lwd=1.5)
